﻿using Microsoft.EntityFrameworkCore.Metadata.Internal;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WxCore.Entity
{
    /// <summary>
    /// 主数据Entity基类，提供通用的字段
    /// </summary>
    public abstract class BaseMainEntity
    {
        /// <summary>
        /// 主键Id
        /// </summary>
        /// <example></example>
        [SugarColumn(ColumnDescription = "Id主键", IsPrimaryKey = true, Length = 36)]
        public virtual string id { get; set; }

        /// <summary>
        /// 名称
        /// </summary>
        /// <example>API测试</example>
        [SugarColumn(ColumnDescription = "名称", IsNullable = true, Length = 255)]
        public virtual string name { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        [SugarColumn(ColumnDescription = "创建时间", IsNullable = true, IsOnlyIgnoreUpdate = true)]
        public virtual DateTime? crtim { get; set; } = DateTime.Now;

        /// <summary>
        /// 更新时间
        /// </summary>
        [SugarColumn(ColumnDescription = "更新时间", IsNullable = true)]
        public virtual DateTime? uptim { get; set; }

        /// <summary>
        /// 创建者Id
        /// </summary>
        [SugarColumn(ColumnName = "crmid", ColumnDescription = "创建者Id", IsNullable = true, IsOnlyIgnoreUpdate = true,
            Length = 36)]
        public virtual string crmid { get; set; }

        /// <summary>
        /// 修改者Id
        /// </summary>
        [SugarColumn(ColumnName = "upmid", ColumnDescription = "修改者Id", IsNullable = true, Length = 36)]
        public virtual string upmid { get; set; }

        /// <summary>
        /// 是否可用，1可用，0不可用
        /// </summary>
        [SugarColumn(ColumnDescription = "可用标记：1可用，0禁用", IsNullable = true)]
        public virtual bool avtag { get; set; } = true;

        /// <summary>
        /// 
        /// </summary>
        [SugarColumn(ColumnDescription = "备注", IsNullable = true, Length = 255)]
        public virtual string notes { get; set; }
    }
}
